package com.dhy.service.imp;

import com.dhy.mapper.DepartmentMapper;
import com.dhy.pojo.Department;
import com.dhy.query.DepartmentQuery;
import com.dhy.service.IDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentServiceImpl implements IDepartmentService {

    @Autowired
    DepartmentMapper departmentMapper;

    @Override
    public void insert(Department department) {

        departmentMapper.insert(department);
    }

    @Override
    public void deleteById(Long id) {
        departmentMapper.deleteById(id);
    }

    @Override
    public void update(Department department) {

        departmentMapper.update(department);
    }

    @Override
    public Department selectById(Long id) {
        return departmentMapper.selectById(id);
    }

    @Override
    public List<Department> selectAll() {

        return departmentMapper.selectAll();
    }

    @Override
    public Long selectPageSize() {
        return departmentMapper.selectPageSize();
    }

    @Override
    public List<Department> selectLimit(DepartmentQuery departmentQuery) {
        return departmentMapper.selectLimit(departmentQuery);
    }

    @Override
    public List<Department> selectByKey(DepartmentQuery departmentQuery) {
        return departmentMapper.selectByKey(departmentQuery);
    }

}
